/*
 * ResourceGuildBuff.h
 *
 *  Created on: 2014. 7. 30.
 *      Author: mega
 */

#ifndef RESOURCEGUILDBUFF_H_
#define RESOURCEGUILDBUFF_H_

#include <map>
#include "../Enum.h"

namespace GuildServer { namespace NResource {

class ResourceGuildBuff
{
public:
	struct Flyweight
	{
		uint16_t guild_grade;
		uint32_t skill_type0_tid;
		uint16_t skill_type1_tid;
		uint16_t skill_type2_tid;
		uint16_t skill_type3_tid;
		uint16_t skill_type4_tid;
		uint16_t skill_type5_tid;
		uint16_t skill_type6_tid;
		uint16_t skill_type7_tid;
		uint16_t skill_type0_rate;
		uint16_t skill_type1_rate;
		uint16_t skill_type2_rate;
		uint16_t skill_type3_rate;
		uint16_t skill_type4_rate;
		uint16_t skill_type5_rate;
		uint16_t skill_type6_rate;
		uint16_t skill_type7_rate;
		uint16_t skill_level1_rate;
		uint16_t skill_level2_rate;
		uint16_t skill_level3_rate;
		uint16_t skill_level4_rate;
		uint16_t skill_level5_rate;
		uint16_t skill_level6_rate;
		uint16_t skill_level7_rate;
		uint16_t skill_level8_rate;
		uint16_t skill_level9_rate;
		uint16_t skill_level10_rate;
	};

public:
	ResourceGuildBuff();
	virtual ~ResourceGuildBuff();

	bool		LoadResource();
	Flyweight *	GetFly(int guild_grade);

	int			GetBuffType(Flyweight * pFly);
	int			GetBuffLevel(Flyweight * pFly);

private:
	void		Clear();

public:
	typedef std::map<int, Flyweight *>		BUFFMAP;

private:
	BUFFMAP	clsFlyMap;
};

} /* namespace NResource */ } /* namespace GuildServer */

#endif /* RESOURCEGUILDBUFF_H_ */
